package scene.scenegraph;

import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

import util.Matrix4f;

public abstract class SceneGraphNode {
	
	public enum NodeType {TRANSFORM, SHAPE};
	
	protected List<SceneGraphNode> children = new ArrayList<SceneGraphNode>();
	protected SceneGraphNode parent;
	
	public SceneGraphNode(SceneGraphNode parent){
		this.parent = parent;
		if(parent != null)
			parent.addChild(this);
	}
	
	public void addChild(SceneGraphNode node){
		children.add(node);
	}
	
	public void removeChild(SceneGraphNode node){
		children.remove(node);
	}
	
	public SceneGraphNode getParent(){
		return parent;
	}
	
	public abstract NodeType getType();
	
	public abstract void traverse(Stack<Matrix4f> stack);
}
